//
//  VerticalButtonControl.m
//  GiftItems
//
//  Created by lanou3g on 15/9/21.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "VerticalButtonControl.h"

@implementation VerticalButtonControl

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        //self.userInteractionEnabled = YES;
        CGFloat height = self.frame.size.height / 7;
        CGFloat width = self.frame.size.width;
        
        UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, 30)];
        view1.backgroundColor = [UIColor grayColor];
        view1.alpha = 0.4;
        [self addSubview:view1];

        
        //初始化纸艺按钮
        _Origami = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _Origami.frame = CGRectMake(0, 30, width, height - 30);
        [_Origami setTitle:@"热门" forState:(UIControlStateNormal)];
        _Origami.backgroundColor = [UIColor whiteColor];
        [_Origami setTitleColor:[UIColor colorWithRed:255.0 / 255 green:151.0 / 255 blue:255.0 / 255 alpha:1.0] forState:UIControlStateNormal];
        _Origami.tag = 1000;
        [self addSubview:_Origami];
        
        
        //初始化布艺按钮
        _clothArt = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _clothArt.frame = CGRectMake(0, height - 30 + 30, width, height - 30);
        [_clothArt setTitle:@"布艺" forState:(UIControlStateNormal)];
        _clothArt.backgroundColor = [UIColor grayColor];
        _clothArt.alpha = 0.4;
        _clothArt.tag = 1001;
        [self addSubview:_clothArt];
        
        
        
        //初始化旧物改造按钮
        _remake = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _remake.frame = CGRectMake(0, 2 * height - 60 + 30, width, height - 30);
        [_remake setTitle:@"纸艺" forState:(UIControlStateNormal)];
        _remake.backgroundColor = [UIColor grayColor];
        _remake.alpha = 0.4;
        _remake.tag = 1002;
        [self addSubview:_remake];
        
        
        //初始化编织按钮
        _plait = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _plait.frame = CGRectMake(0, 3 * height - 90 + 30, width, height - 30);
        [_plait setTitle:@"陶瓷" forState:(UIControlStateNormal)];
        _plait.backgroundColor = [UIColor grayColor];
        _plait.alpha = 0.4;
        _plait.tag = 1003;
        [self addSubview:_plait];
        
        
        //初始化粘土按钮
        _clay = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _clay.frame = CGRectMake(0, 4 * height - 120 + 30, width, height - 30);
        [_clay setTitle:@"粘土" forState:(UIControlStateNormal)];
        _clay.backgroundColor = [UIColor grayColor];
        _clay.alpha = 0.4;
        _clay.tag = 1004;
        [self addSubview:_clay];
        
        
        //初始化画图按钮
        _draw = [UIButton buttonWithType:UIButtonTypeCustom];
        _draw.frame = CGRectMake(0, 5 * height - 150 + 30, width, height - 30);
        [_draw setTitle:@"刺绣" forState:UIControlStateNormal];
        _draw.backgroundColor = [UIColor grayColor];
        _draw.alpha = 0.4;
        _draw.tag = 1005;
        [self addSubview:_draw];
        
        
        //初始化园艺按钮
        _gardening = [UIButton buttonWithType:UIButtonTypeCustom];
        _gardening.frame = CGRectMake(0, 6 * height  - 180 + 30, width, height - 30);
        [_gardening setTitle:@"美食" forState:UIControlStateNormal];
        _gardening.backgroundColor = [UIColor grayColor];
        _gardening.alpha = 0.4;
        _gardening.tag = 1006;
        [self addSubview:_gardening];
        
        
        //初始化美饰按钮
        _emblazonry = [UIButton buttonWithType:UIButtonTypeCustom];
        _emblazonry.frame = CGRectMake(0, 7 * height - 210 + 30, width, height - 30);
        [_emblazonry setTitle:@"美饰" forState:UIControlStateNormal];
        _emblazonry.backgroundColor = [UIColor grayColor];
        _emblazonry.alpha = 0.4;
        _emblazonry.tag = 1007;
        [self addSubview:_emblazonry];
        
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 8 * height - 240 + 30, width, self.frame.size.height - (8 * height - 240))];
        view.backgroundColor = [UIColor grayColor];
        view.alpha = 0.4;
        [self addSubview:view];
        
    }
    return self;
}

@end
